import { QXEvent } from "qx-util";
import { IParam, CalendarExpBarActionType, ICalendarExpBarAbility, ICalendarExpBarControllerParams, ICalendarExpBarStore, CalendarExpBarController, ICtrlEvent, ICalendarExpBarController, ICalendarExpBarModel } from "@/core";
import { useCalendarExpBarAction, useCalendarExpBarBasic, useCalendarExpBarControllerParams, useCalendarExpBarProps } from "@/hooks/widget/use-calendar-exp-bar";
import { model } from "./calendar-exp-viewcalendarexpbar-calendar-exp-bar-model";
// 基于template/src/widgets/{{appEntities}}/{{ctrls@CalendarExpBarEXPBAR}}-calendar-exp-bar/{{spinalCase ctrl.codeName}}-calendar-exp-bar-hook.ts.hbs生成
/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useCalendarExpBarProps(),
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useCalendarExpBarBasic(model, props),
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
		...useCalendarExpBarAction(controller),
	};
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<ICtrlEvent<CalendarExpBarActionType, ICalendarExpBarAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<ICtrlEvent<CalendarExpBarActionType, ICalendarExpBarAbility>>,
    otherParams: IParam = {},
): ICalendarExpBarController<ICalendarExpBarStore, ICalendarExpBarAbility> {
	const params: ICalendarExpBarControllerParams<CalendarExpBarActionType, ICalendarExpBarAbility> =
		useCalendarExpBarControllerParams<ICalendarExpBarStore, ICalendarExpBarModel>(model, props, evt, otherParams);
  	return new CalendarExpBarController(params);
}